<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<title>系统设置-基础设置-安全日志空间告警</title>
<%@ include file="/WEB-INF/jsp/common/inc.jsp" %>
<script type="text/javascript">
$(function (){
	$("#form").validationEngine({
		autoHidePrompt:true,//自动隐藏
		showOnMouseOver:true,//当鼠标移出时触发
		promptPosition:'bottomLeft',//提示信息的位置
		inlineValidation: true,//是否即时验证，false为提交表单时验证,默认true  
		failure : function() {
		    layer.message("验证失败，请检查");
			return false;  
		},//验证失败时调用的函数
		ajaxFormValidation: true,//开始AJAX验证
		success : function() {
		//	$("#addForm").submit();
		}//验证通过时调用的函数 
		//onAjaxFormComplete: ajaxValidationCallback
	});
	
	$("#submit").click(function (){
		if($("#form").validationEngine('validate')){
			var safeLogStorageVal =  $("#safeLogStorage").val();
			if(safeLogStorageVal<1 || safeLogStorageVal>=100){
				layer.msg("占比不能小于1%或不能超过100%");
				return false;
			}
			$.ajax({
				url : "${_baseUrl}/SafeLogStorageAlarm/setSafeLogStorageValue",
				type : "post",
				dataType : "json",
				async : false,
		  		data : {
		  			safeLogStorage : safeLogStorageVal,
		  		},
				success : function(json) {
					layer.msg(json.message);
				},
				error:function(data){
					layer.msg("系统错误,请联系管理员");
				}
			});
		}
	});
	
})

</script>
</head>
<body>
    <form action="" id="form" method="post"  enctype="multipart/form-data">
		<div class="submenu">
		    <div  class="func_header">
		        <span title="基础设置>安全日志空间告警">当前位置 ： <a href="javascript:;">基础设置</a> > 安全日志空间告警</span>
		    </div>
		    
		    <div style="overflow: auto; width:98%;margin: auto;">   
		        
		       <table class="table table-bordered table_inline" id="modelList">
		           <tr>
		               <td>日志空间超过存储空间的</td>
		        	   <td>
		        	       <div class="">
		                       <input type="text" id="safeLogStorage" name="safeLogStorage" class="nav_input validate[required,custom[number]]" value="${safeLogStorage}" placeholder="请输入...">
		                   </div>
		        	   </td>
		        	   <td>%告警</td>
		           </tr>
		       </table>	
			</div>           
	    </div>
	    <div class="important_Preservation">
		    <a href="javascript:;"  id="submit">保存</a>
		</div>
	</form>
</body>
</html>